package org.karelun.rabbit.rcp;

import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.RetargetAction;
import org.karelun.ideaboard.gef.ui.actions.ActionBarContributor;
import org.karelun.ideaboard.gef.ui.actions.DeleteRetargetAction;
import org.karelun.ideaboard.gef.ui.actions.RedoRetargetAction;
import org.karelun.ideaboard.gef.ui.actions.UndoRetargetAction;

public class DiagramActionBarContributor extends ActionBarContributor{

	private class CopyRetargetAction extends RetargetAction{

		public CopyRetargetAction() {
			super(ActionFactory.COPY.getId(), "Copy");
		}
	}
	
	private class CutRetargetACtion extends RetargetAction{

		public CutRetargetACtion() {
			super(ActionFactory.COPY.getId(), "Cut");
		}
	}
	
	private class PasteRetargetAction extends RetargetAction{

		public PasteRetargetAction() {
			super(ActionFactory.PASTE.getId(),"Paste");
		}
	}
	
	@Override
	protected void buildActions() {
		addRetargetAction(new UndoRetargetAction());
		addRetargetAction(new RedoRetargetAction());
		addRetargetAction(new CopyRetargetAction());
		addRetargetAction(new CutRetargetACtion());
		addRetargetAction(new PasteRetargetAction());
		addRetargetAction(new DeleteRetargetAction());
	}

	@Override
	protected void declareGlobalActionKeys() {
		addGlobalActionKey(ActionFactory.CUT.getId());
		addGlobalActionKey(ActionFactory.COPY.getId());
		addGlobalActionKey(ActionFactory.PASTE.getId());
		addGlobalActionKey(ActionFactory.UNDO.getId());
		addGlobalActionKey(ActionFactory.REDO.getId());
	}

}
